<?php

namespace App\Http\Resources\Article\Tab;

use App\Http\Resources\BaseResource;
use App\Models\Article\ArticleModel;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use JsonSerializable;

class HotListResource extends BaseResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
    public function toArray($request): array
    {
        return [
            "id"        => $this->id,
            "type"      => $this->type,
            "typeText"  => translateEnumCodeToCn(ArticleModel::TYPE_TEXT, $this->type),
            "title"     => $this->title,
            "putHotTop" => $this->putHotTop,
            "sort"      => $this->sort,
        ];
    }
}
